package com.mz.mattress.admin.api.req;

import com.mz.mattress.api.entity.Merchant;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 商家申请请求参数
 */
@Data
public class MerchantApplyReq {

    //更新 使用
    private Integer id;

    //手机号
    @NotBlank(message = "请输入手机号")
    private String mobile;

    //商家名
    @NotBlank(message = "请输入名称")
    @Length(max = 28, message = "名称限制28字")
    private String name;

    //省
    @NotNull(message = "请选择省")
    private String province;

    //市
    @NotNull(message = "请选择市")
    private String city;

    //地址
    @NotBlank(message = "请填写地址")
    private String address;

    //经度
    private BigDecimal lon;

    //纬度
    private BigDecimal lat;

    //销售员ID
    private Integer saleId;

    //销售员手机号
    private String saleMobile;

    //营业执照
    @NotBlank(message = "请上传营业执照")
    private String license;

    //身份证照片正面
    @NotBlank(message = "请上传身份证照片正面")
    private String identFront;

    //身份证照片背面
    @NotBlank(message = "请上传身份证照片背面")
    private String identBack;

    //门店图片 多张逗号分割
    private String shop;

    //视频url
    private String video;

    //memberMerId
    private Long memberId;

    public Merchant getMerchant() {
        Merchant merchant = new Merchant();
        merchant.setId(id);
        merchant.setMobile(mobile);
        merchant.setName(name);
        merchant.setProvince(province);
        merchant.setCity(city);
        merchant.setAddress(address);
        merchant.setLon(lon);
        merchant.setLat(lat);
        merchant.setSaleId(saleId);
        merchant.setSaleMobile(saleMobile);
        merchant.setLicense(license);
        merchant.setIdentFront(identFront);
        merchant.setIdentBack(identBack);
        merchant.setShop(shop);
        merchant.setVideo(video);
        return merchant;
    }


}
